package ar.com.source.utilities;

import java.sql.Time;
import java.util.LinkedList;
import java.util.List;

import ar.com.source.dominio.DiaExcel;
import ar.com.source.dominio.Empleado;
import ar.com.source.dto.DiasAlertaDTO;

public class HtmlUtility {


	public static String crearCombo(List<DiasAlertaDTO> diasUsuario) {
		String response = "<legend>Seleccione dias</legend>	<select id=\"combo\">";
		for (DiasAlertaDTO diasAlertaDTO : diasUsuario) {
			if (diasAlertaDTO.isAlert()) {
				response += "<option onClick=\"mostrarTabla()\" style=\"color:red\" value=\"" + diasAlertaDTO.getFecha()
						+ "\">" + diasAlertaDTO.getFecha()	+ "  </option>  ";
			} else {

				response += "<option onClick=\"mostrarTabla()\" value=\"" + diasAlertaDTO.getFecha()
						+ "\"> "+ diasAlertaDTO.getFecha()+" </option>  ";
				
				
			}

		}
		response += "</select>";
		
		return response;

	}

	public static String crearTabla(Empleado empleado){
		
		LinkedList<DiaExcel> diasExcel = empleado.getDiasExcel();
		
		String response ="<table class=\"tabla   table striped bordered hovered\">";
		
		
		response+="<tbody>";
		
		for (DiaExcel diaExcel : diasExcel) {
		response+="<tr class=\"\">";
		
		response+="<td>"+diaExcel.getFecha().toString()+"</td>";
		
		for (Time time : diaExcel.getHoraMarcada()) {
			response+="<td class=\"right\">"+time.toString()+"</td>";
		}
		
		response+="</tr>";
		
		
		}
		
		response+="</tbody>";
		
		
		response+="</tabla>";
		
		return response;
		
	}
	
//	<tbody>
//	<tr class="">
//		<td>Bing</td>
//		<td class="right">0:00:01</td>
//		<td class="right">0,1 Mb</td>
//		<td class="right">0 Mb</td>
//		<td class="right">0,1 Mb</td>
//	</tr>
//	<tr class="">
//		<td>Bing</td>
//		<td class="right">0:00:01</td>
//		<td class="right">0,1 Mb</td>
//		<td class="right">0 Mb</td>
//		<td class="right">0,1 Mb</td>
//	</tr>
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
